package com.project.webapp.action.front.preSchool;

import java.util.List;

import com.project.dao.bean.Recruit;
import com.project.service.front.preSchool.RecruitService;
import com.project.webapp.action.BaseAction;

/**
 * 招聘老师 Action 实作
 * @author Sn
 *
 */
public class RecruitAction extends BaseAction {

	/**
	 * 序列化版本号
	 */
	private static final long serialVersionUID = 1L;
	private String operateResult = "";

	private RecruitService recruitService;
	private Recruit recruit;
	List<Recruit> recruitList;
	
	@Override
	public String execute() throws Exception 
	{
		recruit = new Recruit();
		if(recruitList!=null && recruitList.size()>0)
		{
			recruitList.clear();
		}
		return this.query();
	}
	
	public String showAdd() 
	{
		recruit = new Recruit();
        operateResult = "";
        return SUCCESS;
    }

    /**
     * 
     * <pre>
     * 查询
     * </pre>
     *
     * @return
     */
    public String query() 
    {
        return SUCCESS;
    }
    
    /**
     * 
     * <pre>
     * 保存
     * </pre>
     *
     * @return
     */
    public String save() 
    {
    	try 
    	{
    		recruit.setArea(recruit.getArea_s()+recruit.getArea_e());
    		recruitService.save(recruit);
    		operateResult = "suc";
    	} catch (Exception e) 
    	{
    		e.printStackTrace();
    		operateResult = "fail";
    	}
    	recruit = new Recruit();
    	return "suc";
    }

	public String getOperateResult() {
		return operateResult;
	}

	public void setOperateResult(String operateResult) {
		this.operateResult = operateResult;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public RecruitService getRecruitService() {
		return recruitService;
	}

	public void setRecruitService(RecruitService recruitService) {
		this.recruitService = recruitService;
	}

	public Recruit getRecruit() {
		return recruit;
	}

	public void setRecruit(Recruit recruit) {
		this.recruit = recruit;
	}

	public List<Recruit> getRecruitList() {
		return recruitList;
	}

	public void setRecruitList(List<Recruit> recruitList) {
		this.recruitList = recruitList;
	}


    
}
